package smartcrud.spring.models.cms;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import smartcrud.common.orm.Page;
import smartcrud.common.orm.PropertyFilter;

@Service
public class AttachmentServiceJdbcImpl implements AttachmentService {
	@Autowired
	private AttachmentDao attachmentDao;

	@Override
	public Attachment createAttachment(Attachment o) {
		return attachmentDao.createAttachment(o);
	}

	@Override
	public void deleteAttachment(Long id) {
		attachmentDao.deleteAttachment(id);
	}

	@Override
	public void updateAttachment(Attachment o) {
		attachmentDao.updateAttachment(o);
	}

	@Override
	public Attachment findAttachmentById(Long id) {
		return attachmentDao.findAttachmentById(id);
	}

	@Override
	public List<Attachment> findAllAttachments() {
		return attachmentDao.findAllAttachments();
	}
	
    @Override
    public int count() {
        return attachmentDao.count();
    }	

	@Override
	public Page<Attachment> findByPage(Page<Attachment> page, final List<PropertyFilter> filters) {
		return attachmentDao.findByPage(page,filters);
	}
}
